package com.jzg.jcptadmin.Utils;

import java.util.Calendar;

/**
 * Created by zealjiang on 2017/3/20 17:55.
 * Email: zealjiang@126.com
 */

public class NoDoubleClick {
    private final int MIN_CLICK_DELAY_TIME = 1000;
    private long lastClickTime = 0;

    public boolean canClick(){
        long currentTime = Calendar.getInstance().getTimeInMillis();
        if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentTime;
            return true;
        }else {
            return false;
        }
    }
}
